Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes data-fragment-index on code block #533

Merged
merged 1 commit into from
May 4, 2024

Conversation

jtama
Copy link
Contributor

@jtama jtama commented Apr 29, 2024

Links #532

@ggrossetie
Copy link
Member

Thanks!
Could you please update this test source-highlightjs-languages:source-highlightjs-languages (see CI logs)

@jtama
Copy link
Contributor Author

jtama commented May 2, 2024

Forced push the changes. Tests are passing on my machine 😀

@jtama
Copy link
Contributor Author

jtama commented May 3, 2024

Do you want a sample of it in action ?

@ggrossetie
Copy link
Member

Forced push the changes. Tests are passing on my machine

And it also works on the CI 😉

Do you want a sample of it in action ?

Yes, that would be great! Please add an example in https://github.com/asciidoctor/asciidoctor-reveal.js/blob/master/examples/release-5.2.adoc (it will be published by Netlify: https://deploy-preview-533--asciidoctor-revealjs-examples.netlify.app/release-5.2)

@jtama
Copy link
Contributor Author

jtama commented May 4, 2024

Done !

@ggrossetie
Copy link
Member

@ggrossetie ggrossetie merged commit c69f169 into asciidoctor:master May 4, 2024
14 checks passed
@ipocentro87
Copy link

Hi, thanks a lot for the update.

I wanted to make the listing appearing immediately in the slide, together with the first fragment, do you know how to make that work?
Could it be related to this fragmentIndex += 1;? It seems that even if I set step=0 the listing is not showing.

@jtama
Copy link
Contributor Author

jtama commented Sep 30, 2024

Not sure exactly what you want to achieve.

You want the code to be displayed as soon as the slide is focused with the first callout, is this correct ?

@ipocentro87
Copy link

Yes, basically I'd like that as soon as you move onto the slide, the code snippet that is within that slide is visible, with the focus on the highlighted line at the first step.
For instance, I have the following

[source,,linenums,highlight="2|3-6|2|3-6|2|3-6|13", step=0]
----
<some code>
----

And I'd like that as soon as I jump to that slide, the code snippet is shown, and line 2 is highlighted.

I managed to make a workaround, but it is not ideal as I had to duplicate the code and it doesn't highlight the line 2 straight away.

# overlay the two code blocks
[.r-stack] 
--

[source,,linenums,highlight="2|3-6|2|3-6|2|3-6|13", step=0]
----
<some code>
----

[source.fade-out,,linenums,step=0]
----
<some code>
----

--

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants